load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "edit",
    srcs = [
        "buildozer.go",
        "default_buildifier.go",
        "edit.go",
        "fix.go",
        "types.go",
    ],
    importpath = "github.com/bazelbuild/buildtools/edit",
    visibility = ["//visibility:public"],
    deps = [
        "//api_proto",
        "//build",
        "//build_proto",
        "//edit/bzlmod",
        "//file",
        "//labels",
        "//lang",
        "//tables",
        "//wspace",
        "@com_github_golang_protobuf//jsonpb:go_default_library_gen",
        "@com_github_golang_protobuf//proto:go_default_library",
    ],
)

go_test(
    name = "edit_test",
    srcs = [
        "buildozer_command_file_test.go",
        "buildozer_test.go",
        "edit_test.go",
        "fix_test.go",
    ],
    embed = [":edit"],
    deps = [
        "//build",
        "@com_github_google_go_cmp//cmp",
    ],
)

alias(
    name = "go_default_library",
    actual = ":edit",
    visibility = ["//visibility:public"],
)
